package com.elantra.controller;

import com.alibaba.fastjson.JSONObject;
import com.elantra.base.BaseClass;
import com.elantra.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/org")
public class OrganizationController extends BaseClass {

    @Autowired
    private OrganizationService elantraOrganizationService;


    /**
     * 页面初始化
     */
    @RequestMapping("/init")
    public String init(){
        return "admin/org";
    }

    @RequestMapping(value="/listOrg", method = RequestMethod.POST)
    @ResponseBody
    public JSONObject listOrg(int page, int rows, String orgName){
        return elantraOrganizationService.listOrg(page,rows,orgName);
    }
}
